from django.db import models

# Create your models here.


class MsgModel(models.Model):
    msg_sender = models.CharField(verbose_name="消息发送者", max_length=100)
    msg_content = models.CharField(verbose_name="消息内容", max_length=100)
    msg_createDateTime = models.DateField(verbose_name="消息时间")

    class Meta:
        db_table = 'msgModel'

    def __str__(self):
        return self.msg_sender


class User(models.Model):
    name = models.CharField(max_length=10)
    password = models.CharField(max_length=500)
    mobile = models.CharField(max_length=11)
    # address_s = models.CharField(max_length=100, null=True)
    img = models.CharField(max_length=500, null=True)

    class Meta:
        db_table = 'user'

    def __str__(self):
        return self.name


class UserAddress(models.Model):
    address_ss = models.CharField(max_length=100, null=True)
    editor = models.ForeignKey(User, blank=True, on_delete=models.DO_NOTHING, db_column='User_address')

    class Meta:
        db_table = 'user_address'


# class Horseman(models.Model):
#     name = models.CharField(max_length=10)
#     mobile = models.CharField(max_length=11)
#     address = models.CharField(max_length=100, default=None)
#     img = models.CharField(max_length=500, default=None)
